package main

import (
	"bufio"
	"os"
	"fmt"
)

func main(){
	counts:=make(map[string]int);//make创建空map
	input:=bufio.NewScanner(os.Stdin);//读下一行
	for input.Scan(){
		//counts[input.Text()]++ //左key 右value
		line := input.Text()
		counts[line] = counts[line] + 1 //当map中的value没有值的时候，默认给0
	}

	for line, n:=range counts{
		if n > 0{
			fmt.Printf("%d\t%s\n",n,line);
			fmt.Print(n)
		}
	}
}
